<template>
  <Header class="header">
    <div slot="left" class="header-left" @click.stop="back"></div>
    <ul  slot='center' class="header-title">
      <li :class="{'active' : switchNum === 0}" @click.stop="clickSwitch(0)">我喜欢的</li>
      <li :class="{'active' : switchNum === 1}" @click.stop="clickSwitch(1)">最近收听</li>
    </ul>
    <div slot="right" class="header-right"></div>
  </Header>
</template>

<script>
import Header from "../../components/Header";
export default {
  name: "AccountHeader",
  data() {
    return {
      switchNum: 0
    }
  },
  components:{
    Header
  },
  methods: {
    back() {
      this.$router.go(-1); //返回上一层
    },
    clickSwitch(num) {
      this.switchNum = num;
      this.$emit('clickSwitch', num)
    }
  },
}
</script>

<style scoped lang="scss">
@import "../../assets/css/variable";
@import "../../assets/css/mixin";

.header {


  .header-left {
    @include bg_img("../../assets/images/back")
  }

  .header-right {
    @include bg_img("../../assets/images/more")
  }

  .header-title {
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    @include font_size($font_medium);
    @include no-wrap();
    border: 2px solid #ccc;
    border-radius: 10px;

    li {
      padding: 15px;

      &:nth-of-type(1) {
        border-right: 2px solid #ccc;
      }

      &.active {
        background: rgba(255, 255, 255, .3);
      }
    }
  }
}
</style>
